GBML manual / Tile Animation

background_animation_play

Plays an animated background picture (one made with "Add animated background" in the Paint tab) from where it stopped.

Works differently on Game Boy - An animated background plays only as the room's own picture; any other shows its first frame. It is shown in four greys. 3 squares are redrawn a frame, so a step that changes many squares arrives some frames late.

Works differently on Game Boy Color - An animated background plays only as the room's own picture; any other shows its first frame. A changing square keeps 4 colours (more are cut; the build says how many pixels). 6 squares are redrawn a frame, so a big step arrives a few frames late.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

background_animation_play(picture)

Arguments

NameType
picturetileset

Returns

Nothing.

Description

Plays an animated background - a picture made with Add animated background in the Paint tab - from the frame it stopped on. A room that lists the picture in its Backgrounds can set it to start playing when the room opens (and to play faster or slower); this call is for starting one that stopped, or that started still.

A picture that is already playing, and a picture that is not an animated background at all, are left as they are, so there is no need to guard the call with a check first.

Example

background_animation_play(ts_doc_dungeon);

Starts the picture playing again from the frame it was holding.

On the GBA

A picture that is not an animated background, or one that is already playing, is left as it is. It also starts a background that was set to start paused in the Room Editor.

See also: background_animation_pausebackground_animation_speedbackground_animation_frameTile animation